<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Population figures for Australian States and Territories</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="R.css" />
</head><body>

<table width="100%" summary="page for austpop"><tr><td>austpop</td><td style="text-align: right;">R Documentation</td></tr></table>

<h2>Population figures for Australian States and Territories</h2>

<h3>Description</h3>

<p>Population figures for Australian states and territories for 1917, 1927,
..., 1997.
</p>


<h3>Usage</h3>

<pre>austpop</pre>


<h3>Format</h3>

<p>This data frame contains the following columns:
</p>

<dl>
<dt>year</dt><dd><p>a numeric vector</p>
</dd>
<dt>NSW</dt><dd><p>New South Wales population counts </p>
</dd>
<dt>Vic</dt><dd><p>Victoria population counts</p>
</dd>
<dt>Qld</dt><dd><p>Queensland population counts</p>
</dd>
<dt>SA</dt><dd><p>South Australia population counts</p>
</dd>
<dt>WA</dt><dd><p>Western Australia population counts</p>
</dd>
<dt>Tas</dt><dd><p>Tasmania population counts</p>
</dd>
<dt>NT</dt><dd><p>Northern Territory population 
counts</p>
</dd>
<dt>ACT</dt><dd><p>Australian Capital Territory 
population counts</p>
</dd>
<dt>Aust</dt><dd><p>Population counts for
the whole country</p>
</dd>
</dl>



<h3>Source</h3>

<p>Australian Bureau of Statistics
</p>


<h3>Examples</h3>

<pre>
print("Looping - Example 1.7")

growth.rates &lt;- numeric(8)
for (j in seq(2,9)) {
    growth.rates[j-1] &lt;- (austpop[9, j]-austpop[1, j])/austpop[1, j] }
growth.rates &lt;- data.frame(growth.rates)
row.names(growth.rates) &lt;- names(austpop[c(-1,-10)])
  # Note the use of row.names() to name the rows of the data frame
growth.rates

pause()
print("Avoiding Loops - Example 1.7b")

sapply(austpop[,-c(1,10)], function(x){(x[9]-x[1])/x[1]})

pause()
print("Plot - Example 1.8a")
attach(austpop)
plot(year, ACT, type="l") # Join the points ("l" = "line")
detach(austpop)

pause()
print("Exerice 1.12.9")
attach(austpop)
oldpar &lt;- par(mfrow=c(2,4))  
for (i in 2:9){
plot(austpop[,1], log(austpop[, i]), xlab="Year",
    ylab=names(austpop)[i], pch=16, ylim=c(0,10))}
par(oldpar) 
detach(austpop)

</pre>


</body></html>
